package com.sparrow.core.asm;

import java.net.URLClassLoader;
import java.net.URL;

public class DynamicClassLoader extends URLClassLoader {
	public DynamicClassLoader(ClassLoader classLoader) {
		super(new URL[0], classLoader);
	}

	public Class<?> findClassByClassName(String className)
			throws ClassNotFoundException {
		return this.findClass(className);
	}

	public Class<?> loadClass(String fullName, JavaClassFileObject jco) {
		byte[] classData = jco.getBytes();
		return this.defineClass(fullName, classData, 0, classData.length);
	}
}
